package top.hkyzf.study.leetcode.math;

import org.junit.Test;

/**
 * @author 朱峰
 * @date 2022-1-15 10:57
 */
public class 计算力扣银行的钱_1716 {
    public int totalMoney(int n) {
        int week = 7;
        int start = 0;
        int total = 0;
        int current = 0;
        for (int i = 0; i < n; i++) {
            if(i % week == 0) {
                start++;
                current = start;
            } else {
                current++;
            }
            total = total + current;
        }
        return total;
    }

    @Test
    public void testTotalMoney () {
        int n = 20;
        int totalMoney = totalMoney(n);
        System.out.println(totalMoney);
    }
}
